package com.example.fw;

import org.netbeans.jemmy.operators.JMenuBarOperator;
import org.netbeans.jemmy.operators.JTreeOperator;

public class MenuHelper extends HelpersBase{

	public MenuHelper(AppManager appManager) {
		super(appManager); 
	}

	public void pushCreateFolder() {
		JMenuBarOperator menu = new JMenuBarOperator(mainFrame);
		menu.pushMenuNoBlock("File|New folder...");
	}
	
	public void pushDelete() {
		JMenuBarOperator menu = new JMenuBarOperator(mainFrame);
		menu.pushMenuNoBlock("File|Delete");
	}
	
	public void selectFolder(String folderName) {
		JTreeOperator tree = new JTreeOperator(mainFrame);
		if (tree.findRow(folderName) != -1)
			tree.selectRow(tree.findRow(folderName));
		else
			throw new Error("There're not folder with '"+folderName+"' name");
	}
}
